package com.google.code.xconf.utils;

public class StringTools {

    public static boolean isEmpty(String string) {
        return string == null || string.trim().isEmpty();
    }

    public static boolean equals(String s1, String s2) {
        if (s1 == null) {
            return s2 == null;
        }
        return s1.equals(s2);
    }

    public static boolean isNumberAssignable(String s) {
        if (StringTools.isEmpty(s)) return false;
        try {
            //noinspection ResultOfMethodCallIgnored
            Double.valueOf(s);
            return true;
        } catch (NumberFormatException e) {
            return false;
        }
    }

}
